package com.hxy.security;

import org.springframework.security.crypto.password.PasswordEncoder;

public class MyPasswordEncoder implements PasswordEncoder {
    /**
     * 编码
     *
     * @param charSequence
     * @return
     */
    @Override
    public String encode(CharSequence charSequence) {
        System.out.println("密码：" + charSequence.toString());
        return charSequence + "aaa";
    }

    /**
     *
     * @param charSequence：表单提交得密码
     * @param s：正确密码
     * @return
     */
    @Override
    public boolean matches(CharSequence charSequence, String s) {
        System.out.println("匹配：" + charSequence.toString() + "\t" + s);
        return charSequence.equals(s);
    }
}
